/**
 * Created by Administrator on 2017/6/23 0023.
 */
define([], function () {
    var tpl = {};
    tpl.init = function () {
        var html = '';
        html += babyInfo();
        return html;
    }
    tpl.init2 = function () {
        var html = '';
        html += babyList();
        return html;
    }
    tpl.init3 = function () {
        var html = '';
        html += babyInfoNew();
        return html;
    }
    tpl.init4 = function () {
        var html = '';
        html += history();
        return html;
    }
    tpl.init5 = function () {
        var html = '';
        html += searchBox();
        return html;
    }
    tpl.init6 = function () {
        var html = '';
        html += searchList();
        return html;
    }
    var babyInfo = function () {
        return '<script id="babyInfo-tpl" type="text/html">' +
                    '<li>宝宝姓名<span id="name">{{userName}}</span></li>'+
                    '<li>宝宝月龄<span id="monthsOfAge">{{monthAge}}</span></li>'+
                    '<li>出生体重<span id="weight">{{weight}}</span></li>'+
                    '<li>是否早产<span id="prematureDelivery">{{pretermBirth}}</span></li>'+
                    '<li>{{itemName}}<span id="gestationalAge">{{age}}</span></li>'+
                    '<li>分娩住院号<span id="hospitalNumber">{{hospitalNumber}}</span></li>'+
                    '<li>门诊号<span id="clinic">{{clinic}}</span></li>'+
                    '<li>社保卡号<span id="card">{{card}}</span></li>'+
                    '<li>自管卡号<span id="selfManagementCard">{{selfManagementCard}}</span></li>'+
            '</script>';
    }
    var babyList = function () {
        return '<script id="babyList-tpl" type="text/html">' +
                    '{{each data as value }}'+
                     '<ul class="clearfix" babyId="{{value.patientId}}" patientSchemeId="{{value.patientSchemeId}}">'+
                         '<li>{{value.patientName}}</li>'+
                         '<li>{{value.phoneNum}}</li>'+
                         '<li>{{value.monthAge}}</li>'+
                         '<li>{{value.birthWeight}}</li>'+
                         '<li>{{value.pretermBirth}}</li>'+
                         '<li>{{value.pregnancyDay}}</li>'+
                         '<li>{{value.inpatientNo}}</li>'+
                         '<li>{{value.outPatientNo}}</li>'+
                         '<li>{{value.socialCardNo}}</li>'+
                         '<li>{{value.selfCardNo}}</li>'+
                     '</ul>'+
                '{{/each}}'+
            '</script>';
    }
    var babyInfoNew=function(){
        return '<script id="babyInfo-new-tpl" type="text/html">' +
            '<li>宝宝姓名：{{userName}}</li>'+
            '<li>宝宝月龄：{{monthAge}}</li>'+
            '<li>出生体重：{{weight}}</li>'+
            '<li>是否早产：{{pretermBirth}}</li>'+
            '<li>{{itemName}}：{{age}}</li>'+
            '<li>分娩住院号：{{hospitalNumber}}</li>'+
            '<li>门诊号：{{clinic}}</li>'+
            '<li>社保卡号：{{card}}</li>'+
            '<li>自管卡号：{{selfManagementCard}}</li>'+
            '</script>';
    }
    var history = function(){
        return 	'<script id="history-tpl" type="text/html">'+
            '	<div class="panel-top">历史记录'+
            '   </div>'+
            '	{{each rows as value i}}'+
            '   <div class="historyList" userId="{{value.userId}}">{{value.testTime}}</div>'+
            '	{{/each}}'+
            '<script>';
    }
    var searchBox=function (){
        return 	'<script id="searchBox-tpl" type="text/html">'+
                    '<div class="modal fade" tabindex="-1" role="dialog" id="myModal">'+
                        '<div class="modal-dialog" role="document">'+
                            '<div class="modal-content">'+
                                '<div class="modal-header">'+
                                    '<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>'+
                                    '<h4 class="modal-title">新建患者评估</h4>'+
                                ' </div>'+
                                '<div class="modal-body clearfix">'+
                                    '<div class="col-md-10 col-md-offset-1">'+
                                        '<form>'+
                                            '<div class="form-group">'+
                                                '<div class="input-group">'+
                                                '<input type="text" class="form-control" id="searchUser" placeholder="请输入姓名/手机号"  autocomplete="off">'+
                                                '<div class="input-group-addon" id="toSearch"><i class="fa fa-search" aria-hidden="true"></i></div>'+
                                                '</div>'+
                                            '</div>'+
                                        '</form>'+
                                        '<div class="infoList clearfix">'+
                                            '<ul id="infoLists"></ul>'+
                                        '</div>'+
                                    '</div>'+
                            '</div>'+
                        '</div>'+
                    '</div>'+
        '<script>';
    }
    var searchList = function(){
        return  '<script id="searchList-tpl" type="text/html">' +
            '{{each data as value}}'+
            '<li userId="{{value.patientId}}" phone="{{value.phoneNum}}" birthday = "{{value.birthday}}" pregnancyDay = "{{value.pregnancyDay}}"><span class="userName">{{value.patientName}}</span>&nbsp;&nbsp;'+
            '{{if value.gender=="F"}}' +
            '   <span class="sex">女&nbsp;&nbsp;</span>'+
            '{{else}}'+
            '   <span class="sex">男&nbsp;&nbsp;</span>'+
            '{{/if}}'+
            '<span class="age">&nbsp;&nbsp;{{value.age}}</span>'+
            '</li>'+
            '{{/each}}'+
            '</script>';
    }
    return tpl;
});
